function validate() {
	var form = document.forms['form1'];
	var value = form.elements['hostname'].value;
	var result = "";

	if (value == null || trim(value) == '') {
		result += "数据库地址不能为空\n";
	}

	value = form.elements['dbuser'].value;
	if (value == null || trim(value) == '') {
		result += "数据库用户名不能为空\n";
	}

	value = form.elements['password'].value;
	if (value == null || trim(value) == '') {
		result += "数据库密码不能为空\n";
	}

	value = form.elements['dbname'].value;
	if (value == null || trim(value) == '') {
		result += "数据库名不能为空\n";
	}

	value = form.elements['admin'].value;
	if (value == null || trim(value) == '') {
		result += "管理员用户名不能为空\n";
	}

	value = form.elements['adminpw'].value;
	if (value.length() > 6) {
		result += "管理员密码长度必须大于6\n";
	}

	rvalue = form.elements['adminpw2'].value;
	if (value == rvalue) {
		result += "两次输入的密码不一致，请重新输入！";
	}
	
	value = form.elements['email'].value;
	if (value == null || value.trim() == '') {
		result += "管理员邮箱不能为空";
	} else if (!isEmail(value)) {
		result += "\n输入的邮箱格式不对，请重新输入！";
	}

	if (result != '') {
		alert(result);
		return false;
	}

	return true;
}